import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "../views/Login";
import Home from "../views/Home";
import Admin from "../views/admin/Admin";
import Role from "../views/admin/Role";
import Permission from "../views/admin/Permission";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/admin',
        name: 'Admin',
        component: Admin
      },
      {
        path: '/role',
        name: 'Role',
        component: Role
      },
      {
        path: '/permission',
        name: 'Permission',
        component: Permission
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
